﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using TuanAnhPersonalWeb.Models;

namespace TuanAnhPersonalWeb.Controllers
{
    public class GalleryController : Controller
    {
        //
        // GET: /Gallery/
        
        TuanAnhEntities db = new TuanAnhEntities();
        public ActionResult Index()
        {

            IEnumerable<TUANANH__ALBUM> listalbum = db.TUANANH__ALBUM;
            return View(listalbum);
        }

        public ActionResult DetailAlbum(int idalbum)
        {
            ViewBag.AlbumName = db.TUANANH__ALBUM.Where(x => x.ALBUM_ID == idalbum).Select(c => c.ALBUM_TITLE).SingleOrDefault();
            IEnumerable<TUANANH__IMAGE> listimage = db.TUANANH__IMAGE.Where(x => x.ALBUM_ID == idalbum);
            return PartialView("ListImages", listimage);
        }

    }
}
